import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";

// https://vitejs.dev/config/
export default defineConfig({
    build: {
        sourcemap: process.env.NODE_ENV === 'development',
    },
    plugins: [
        uni(),
    ],
    server: {
        host: '0.0.0.0',
        proxy: {
            '/api': {
                // target: 'http://120.48.126.162:8080',
                target: 'http://localhost:8080',
                secure: false,
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        }
    }
});
